import apiClient from '@/api/apiClient';

import { UserInfo } from '#/entity';
import { BasicStatus } from '#/enum';

export interface RoleQueryForm {
  take: number;
  page: number;
}

export interface RoleCreateForm {
  code: string;
  name: string;
  status: BasicStatus;
  remark: string;
}

// /session
const getPersonalInfo = () => apiClient.get<UserInfo>({ url: '/session' });

const updateInfo = (data: any) => apiClient.post({ url: '/session/update_info', data });

// /file/oss/upload
const uploadAvatar = (data: any) => apiClient.post({ url: '/file/oss/upload', data });

export default {
  getPersonalInfo,
  updateInfo,
  uploadAvatar,
};
